package com.tinalucky.test;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;

@Data
@ToString
@AllArgsConstructor
@NoArgsConstructor
@Component
@ConfigurationProperties(prefix = "person")
@RestController
public class Person {
    private String name;
    private int age;
    private Date birthday;
    private Pet[] myPets;

    @RequestMapping("/person")
    public Person person() {
        //Person tinalucky = new Person("tinalucky", 28, new Date(), new Pet[]{});
        Person person = new Person();
        return person;
    }

}
